﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace Spencen.Mobile.Markup
{
    public class XamlElement : XamlElementBase
    {
        public XamlElement( XamlNode parent, string name, string @namespace ) : base( parent, name, @namespace )
        {
            Attributes = new List<XamlAttribute>();
            Properties = new List<XamlElementProperty>();
        }

        public Type Type { get; set; }
        public ConstructorInfo Constructor { get; set; }
        public IList<XamlAttribute> ConstructorArgs { get; set; }
        public IList<XamlAttribute> Attributes { get; private set; }
        public string ResourceKey { get; set; }
        public string ResourceName { get; set; }

        public IList<XamlElementProperty> Properties { get; private set; }

        public override string MemberName { get { return Name; } }

        public bool IsNamed { get { return !string.IsNullOrEmpty( ResourceName ); } }
    }
}
